
export const required = (text) => {
    return { required: true, message: `${text}为必填项！`, trigger: 'blur' }
}

export const length = (min, max, text) => {
    return { max, min, message: `${text}的长度为${min}--${max}`, trigger: 'blur' }
}


/**
 * @description: 人员检验规则
 * @return {*}
 */
export const personRule = {
    PersonID: [required('人员编号')],
    DepartID: [required('部门')],
    PersonName: [required('人员姓名')],
    IdentityNumber: [required('身份证号')],
    OnJobDate: [required('入职日期')],
    WorkType: [required('就职状态')],
    CalID: [required('行事历')]
}



/**
 * @description: 供应商校验规则
 * @return {*}
 */
export const supplierRule = {
    ID: [required('供应商编号')],
    FullName: [required('供应商全称')],
    FundsAttribution: [required('账款归属')],
    PersonID: [required('采购人员')],
}

/**
 * @description: 客户检验规则
 * @return {*}
 */
export const customerRule = {
    ID: [required('客户编号')],
    FullName: [required('客户全称')],
    FundsAttribution: [required('账款归属')],
    PersonID: [required('业务人员')],
}



/**
 * @description: 朗赛德粤语版，采购入库
 * @return {*}
 */
export const lsdOrderRuKuRule = {
    supplierName: [required('供应商')],
    personName: [required('采购人员')]
}

/**
 * @description: 部门检验规则
 * @return {*}
 */
export const departRule = {
    DepartID: [required('部门编号')],
    DepartName: [required('部门名称')]
}

/**
 * @description: 客户类别检验规则
 * @return {*}
 */
export const customerClassRule = {
    ClassID: [required('客户类别编号')],
    ClassName: [required('客户类别名称')]
}

/**
 * @description: 供应商检验规则
 * @return {*}
 */
export const supplierClassRule = {
    ClassID: [required('供应商类别编号')],
    ClassName: [required('供应商类别名称')]
}

/**
 * @description: 产品类别校验规则
 * @return {*}
 */
export const productClassRule = {
    ClassID: [required('产品类别编号')],
    ClassName: [required('产品类别名称')]
}


/**
 * @description: 计量单位校验规则
 * @return {*}
 */
export const stdUnitRule = {
    UnitID: [required('单位编号')],
    UnitName: [required('单位名称')]
}

/**
 * @description: 币别校验规则
 * @return {*}
 */
export const currencySysRule = {
    CurrencyID: [required('币别编号')],
    CurrencyName: [required('币别名称')]
}

/**
 * @description: 产品资料校验规则
 * @return {*}
 */
export const productRule = {
    ProdID: [required('产品编号')],
    ClassExId: [required('产品类别')],
    ProdName: [required('产品名称')],
    UnitID: [required('基本单位')],
    CurrID: [required('使用币别')],
    WareID: [required('默认仓库')],
    ProdForm: [required('产品型态')]
}


/**
 * @description: 客户信息校验规则
 * @return {*}
 */
export const customerFormRule = {
    a_user: [required('客户编号')],
    company: [required('客户名称')],
    ip: [required('IP地址')],
    port: [required('端口号')],
    zt: [required('账套')],
    sqlUser: [required('sql用户')],
    sqlPass: [required('sql密码')],
    effective: [required('到期时间')],
    type: [required('客户类型')],
    canUse: [required('用户数')]
}